package 剑指Offer.medium;

import java.util.Arrays;

public class 数组中数字出现的次数2 {
    class Solution {
        public int singleNumber(int[] nums) {
            Arrays.sort(nums);
            for (int i = 0; i < nums.length - 2; i++) {
                if (nums[i] != nums[i + 3]) return nums[i];
            }
            return nums[nums.length - 1];
        }
    }
}
